1. Field of the Invention
The present invention relates to adjustment of buffer parameters in a hard disk drive system.
2. Background of the Related Art
Conventional hard disk drives generally include two individual data transfer engines configured to cooperatively move data into and out of a hard disk drive storage medium, as shown in FIG. 1. The first of the two engines, typically referred to as the drive side engine 101, is generally responsible for transferring data between a memory buffer 102, which may be a bank of dynamic random access memory (DRAM), and the magnetic media 100 of the hard disk drive. The second of the two engines, typically referred to as the host side engine 103, is responsible for transferring data between the memory buffer 102 and a host interface 104. The host interface 104 may be, for example, an advanced technology attachment interface (ATA), a small computer systems interface (SCSI and/or scuzzy), fiber channel arbitrated loop (FC-AL), and/or another known interface configurations. The first and second engines generally operate independently of each other, but often operate to transfer data into and out of the memory buffer 102 simultaneously. Additionally, the first and second engines often operate at different data transfer speeds, as host-type interfaces often operate in the 1 to 2 gigabit range, while the interface between a hard disk drive and a memory are traditionally much slower, generally in the range of 20 to 60 megabytes.
In an operation to read data from the hard disk drive, for example, when a device requests information residing on the hard disk drive, the drive side engine 101 generally operates to transfer the requested data from the storage medium 100 of the hard disk drive to the memory buffer 102. After a predetermined period of time has passed, the host engine 103 will generally begin moving data transferred to the memory buffer 102 by the drive side engine 101 to the host interface 104 for distribution to the device requesting the data from the hard disk drive. It is important that the host side wait before initiating data transfer, as the host side is generally capable of transferring data at a substantially faster rate. Therefore, the host is capable of rapidly catching up to the drive side, which results in performance delays, as the host side engine must then be temporarily disabled in order to allow the drive side transfer more data for the host side to process/transfer. After the drive side initiates data transfer, it will eventually complete the transfer of the requested information from the medium of the hard disk drive to the memory buffer. At some time after drive side engine initiates data transfer, host side engine starts transfer and eventually completes transfer of the requested data from the memory buffer to the host interface. Once the host side engine completes the transfer of data from the memory buffer to the host interface, the data transfer process for that particular read operation is generally complete. However, in a typical hard disk drive configuration, there are generally multiple individual segments of data transferred in order to complete a single transfer command, and therefore, the host side may regularly catch up to the drive side at the end of each data segment transfer. These end of segment-type catch-up conditions may generally be referred to as desired catch-up conditions, and are expected to continue until the segments are collectively transferred, thus completing the individual transfer command.
A similar operation is conducted for writing data to the hard disk drive, however, the data flow and respective engine handling is essentially reversed. Therefore, when a device is to write data to the hard disk drive, the host side engine generally begins to transfer the portion of data to the memory buffer from the host interface, for example, a segment of data. The memory buffer will begin to fill up with the data to be written, and therefore, at some predetermined time thereafter, which is generally as quickly as possible, the drive side engine begins to transfer data into the drive storage medium for storage thereon. Both engines may simultaneously transfer data to and from the memory buffer until the data is completely transferred to the hard disk drive. This simultaneous transfer operation generally occurs in segments or blocks, in similar fashion to the above noted read operation. However, drive side catch-up conditions are generally much less frequent than host side catch-up conditions, as the performance penalty associated with a drive side catch-up is substantially greater than a host side, and is therefore to be avoided. In this configuration the host side engine generally completes data transfer operations prior to the data side engine.
However, since the drive and host side engines generally operate at different data transfer rates, one engine may xe2x80x9ccatch-upxe2x80x9d to the other engine during a data transfer operation, irrespective of the direction of the data transfer. In this situation, the transfer operations of engine that has caught up must be halted, and the engine must wait until the other engine has transferred additional data, i.e., caught up, before the halted engine can reinitiate and continue its own data transfer operations. If the host side engine catches up to the drive side engine, then the catch-up condition is generally referred to as a host catch-up. Alternatively, if the drive side engine catches up to the host side engine, then the catch up condition is generally referred to as a drive catch-up. Both of these conditions are detrimental to the efficiency and performance of the hard disk drive and the surrounding components/devices, as each time a catch-up event occurs, an efficiency/performance penalty is incurred, as the respective engine is halted while the software intervenes to calculate when the engine may be subsequently restarted.
On hard disk drives in particular, drive catch-up conditions have a substantial performance penalty, as it requires one complete revolution of the hard disk storage medium before access to the storage medium may be reinitiated at the same location at which the previous data read/write was stopped. For example, on a 10,000 revolution per minute disk drive, the timing penalty for waiting for the drive medium to complete a single revolution to return to the point on the drive at which the drive medium was halted would be at least 6 milliseconds. Although host catch-up penalties are typically smaller than drive catch-up penalties and depend primarily upon the specific type of interface used, host catch-up penalties nevertheless also contribute to decreased system performance. In a fiber channel arbitrated loop configuration (FC-AL), for example, the halt/wait time penalty generally amounts to the time required to re-arbitrate for the loop. However, on large loops or public loops, the wait time penalty can be significantly increased and become a substantial factor in decreased system performance. Both types of catch-up conditions generally require software intervention to halt and/or reinitiate the respective transfer engine. As a result thereof, both catch-up conditions require allocation of valuable processor cycles, which reduces the number of processor cycles available for other devices and tasks, such as, for example, command reordering.
In view of the performance degradation resulting from catch-up conditions, it is desirable to have a logical structure and/or controlling-type software for hard disk drives that is configured to avoid catch-up conditions and to optimize the host side engine usage so as to reduce the number of times it must be re-started. Some conventional scuzzy-type devices attempt to accomplish this task via allowing users selective control over when the host side engine initiates data transfer. This selective control is generally based upon timing of the host engine""s initialization of data transfer with respect to the drive side engine. This timing is generally based upon the size of the intermediately positioned memory buffer and the transfer speeds of the respective engines. In particular, conventional devices may allow users to set the Read Full Ratio in Mode Page 2 for read commands. This ratio generally represents a fraction that indicates how full the drive buffer should be before host data starts getting transferred out of the buffer, i.e., 40% or 80%, for example. There is also a corresponding Write Empty Ratio parameter, which represents how empty the buffer should be before the drive engine should request more data to be written thereto, that can be specified for write commands. These are fixed ratios that a sophisticated customer may be able to use in order to maximize loop performance for case specific tasks under very specific conditions. However, the manipulation of these parameters requires that the user have substantial understanding of the respective system and that the respective system has a predictable and relatively constant loop response. However, if system conditions change, as they often do, then the fixed ratios are no longer appropriate and must be recalculated by the user, which may be a substantial task. As an alternative to manually manipulating these parameters, the user may allow the hard disk drive to determine when to start the host side engine in reference to the drive side engine by setting one or both of the Read Full Ratio and Write Empty Ratio to zero. This is generally referred to in the art as using an xe2x80x9cadaptive ratio,xe2x80x9d which indicates that a consistent value is used to adjust the engine start times. This value remains constant during operation and is not adjusted for system changes.
For example, an SCSI interface utilizes an inter-locked bus design that allows for a relatively high degree of predictability on data transfers. In particular, once a device on an SCSI interface arbitrates and gains control of the bus, data may be instantaneously transferred from one device to the other device. Therefore, generally the only variable that needs to be considered when calculating the optimal time to start the host engine on a transfer, e.g., the adaptive ratios, aside from the respective engine speeds, is the amount of time it takes to gain control of the bus. Therefore, using a worst case bus workload scenario, the amount of time required to gain control of the bus can be calculated and used to represent all other workload cases. This amount of time is relatively constant and with minimal padding can be set so as to generally avoid a drive catch-up condition, while also minimizing the number of host catch-ups conditions. Since the calculated worst case time to gain control of the bus generally remains constant for writes or reads and generally does not vary from system to system, this approach is generally effective for SCSI based devices.
Alternatively, FC-AL interfaces have a number of variables that contribute to the calculation of the adaptive ratio. As such, FC-AL interfaces are substantially less predictable than SCSI interfaces. For example, on an FC-AL loop, the ability to arbitrate for control of the loop generally depends upon factors such as the loop traffic and the number of ports present on the loop. Therefore, on a busy loop with a large number of ports, the delay required to arbitrate for control of the bus could easily be several milli-seconds. Additionally, in an FC-AL configuration data is not instantaneously transferred between devices on a loop, as there is some finite delay between the time when one device sends data and another device actually receives the data. This delay generally increases as the loop size grows, and therefore, increases substantially if there is an interstitially positioned fabric. Furthermore, FC-AL includes unique handling procedures for write data, as the drive sends a Transfer Ready frame when it is ready to begin receiving write data frames. The drive, however, has no control over when the receiver of the Transfer Ready frame will turn around and begin sending these data frames. This turn around time varies from adaptor to adaptor and from system to system, and therefore, further contributes to making it increasingly difficult to calculate the adaptive ratios for an FC-AL type system.
Therefore, in view of the deficiencies of conventional methods for adjusting the adaptive ratios for an FC-AL based configuration, there exists a need for a method and/or apparatus for dynamically calculating adaptive ratios in FC-AL based systems. In particular, there is a need a method and/or apparatus for dynamically calculating the adaptive ratios for a hard disk drive resident in an FC-AL type interface. The method and apparatus would preferably be configured to account for the large amount of variability in a FC-AL interface and dynamically calculate adaptive ratios based upon current and previous interface conditions.
Embodiments of the present invention provide a method for dynamically adjusting engine startup parameters for a hard disk drive system, wherein the method includes determining if a drive catch-up or a host catch-up condition has occurred and adjusting at least one of a read pad and a write pad if a drive catch-up condition is determined. Further, the method includes calculating a pad parameter and an optimal delay parameter if a host catch-up condition is determined, and thereafter, adjusting the optimal delay parameter with the pad parameter.
Embodiments of the present invention further provide a method for dynamically adjusting buffer ratios in an fiber channel arbitrated loop-based hard disk drive system. The method includes increasing a drive pad parameter if a drive side catch-up is determined. Alternatively, if a host catch-up is determined, the method includes calculating a host pad parameter, calculating an optimal interrupt logical block address, and calculating an adjustment parameter.
Thereafter, the method includes adjusting the optimal interrupt logical block address with the adjustment parameter, and modifying the adjusted optimal interrupt block address with the host pad parameter.
Embodiments of the present invention further provide a computer readable medium storing a software program thereon, that when executed by a processor, causes the processor to perform a method including the steps of determining if a drive catch-up or a host catch-up condition has occurred and adjusting at least one of a read pad and a write pad if a drive catch-up condition is determined. The method further includes calculating a pad parameter and an optimal delay parameter, and then adjusting the optimal delay parameter with the pad parameter if a host catch-up condition is determined.
Embodiments of the present invention further provide a computer readable medium storing a software program thereon, that when executed by a processor, causes the processor to dynamically adjusting buffer ratios. The method includes increasing a drive pad parameter if a drive side catch-up is determined. Alternatively, if a host catch-up is determined, the method includes calculating a host pad parameter, calculating an optimal interrupt logical block address, and calculating an adjustment parameter. Thereafter, the method includes adjusting the optimal interrupt logical block address with the adjustment parameter, and modifying the adjusted optimal interrupt block address with the host pad parameter.